package com.heqiang.controller;

import com.heqiang.domain.Role;
import com.heqiang.service.RoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


import java.util.List;

@Controller
@RequestMapping("/role")
@Slf4j
public class RoleController {

    @Autowired
    private RoleService service;

    /****************************************************** Query *****************************************************/
    /**
     * 查询-角色列表
     * zhang he qiang
     * @Date 2020/7/24
     * @Return org.springframework.web.servlet.ModelAndView
     **/
    @RequestMapping("/findAll")
    @ResponseBody
    public List<Role> findAll(Role role, Model model) {
        log.info("==============查询角色列表==============");
        return  service.findAll(role);
    }
}
